package org.alis.rpc.common.bean;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @author lc
 * @version v1.0.0
 * @date 2020/8/20 16:49
 * @className RpcResponse.class
 */
@Data
public class RpcResponse<V> implements Serializable {
    private static final long serialVersionUID = 8215493329459772524L;

    private String requestId;
    private String error;
    private V result;

    public boolean isError(){
        return StringUtils.isNotBlank(error);
    }

    public V getResult(){
        return result;
    }
}
